
package com.probiz.estore.sales.service.dwr;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.MessageSource;

import com.probiz.estore.sales.model.CouponTypeVO;
import com.probiz.estore.common.model.sales.PromoRule;
import com.probiz.estore.sales.service.PromoRuleManager;

public class CouponTypeDwrImpl {
	protected final transient Log	log				= LogFactory
															.getLog(getClass());
	private PromoRuleManager		mgr				= null;

	public List getCouponTypes() {
		List rs = new ArrayList();
		for (PromoRule promoRule : mgr.getAllCouponTypesInProcessOrInFuture()) {
			CouponTypeVO vo = new CouponTypeVO();
			vo.setCouponTypeId(promoRule.getPromoRuleId());
			vo.setCouponTypeName(promoRule.getName());
			rs.add(vo);
		}
		return rs;
	}

	public void setPromoRuleManager(PromoRuleManager manager) {
		mgr = manager;
	}

}
